package com.neiquan.backstage.region.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neiquan.backstage.common.util.ExtraSpringHibernateTemplate;
import com.neiquan.backstage.pub.bsc.dao.po.Province;
import com.neiquan.backstage.region.RegionService;

@Service
public class RegionServiceImpl implements RegionService {
	@Autowired
	private ExtraSpringHibernateTemplate extraSpringHibernateTemplate;

	@Override
	public List<Province> queryAllProvince() {
		return extraSpringHibernateTemplate.findAll(Province.class);
	}

	@Override
	public Province queryProvinceByCode(String code) {
		return extraSpringHibernateTemplate.findFirstOneByPropEq(Province.class, "code", code);
	}
}
